<?php
	include_once '../../conn/all.php';
	if (isset($_GET['id'])) {
		$id=$_GET['id'];
		$class=$_GET['class'];
		$res=sql("s", "article_tab", "*","where id=".$id);
		$id_get="&id=".$id;
		$order=$res['order_int'];
		$top=$res["top"];
		$recommend=$res['recommend'];
		$keyword=$res["keyword"];
		$decription=$res["description"];
		$content=$res["content"];
		$title=$res["title"];
		$imgurl=$res['imgurl'];
	}else{
		$id='';
		$id_get="";
		$class=$_GET['class'];
		$order="";
		$top="";
		$recommend="";
		$keyword="";
		$decription="";
		$content="";
		$title="";
		$imgurl="";
	}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="../templates/met/images/css/reset.css" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="../templates/met/images/css/metinfo.css" />
<script type="text/javascript"src="../include/metvar.js"></script>
<script type="text/javascript" src="../include/metinfo.js"></script>
<script type="text/javascript" src="../../public/js/metinfo-min.js"></script>
<script type="text/javascript" src="../templates/met/images/js/iframes.js"></script>
<script type="text/javascript" src="../templates/met/images/js/cookie.js"></script>
<style type="text/css">
body{
	font-size: ; 
	font-family:;
	text-align:center;
}
</style>
<script type="text/javascript">
//ajax执行时间
var time=200;
var lang = 'cn';
var metimgurl='../templates/met/images/';
</script>
<script type="text/javascript">
	$(document).keypress(function(e){  
	var type = e.keyCode||e.which||e.charCode;
		if(type==27){ 		
			parent.sitemp('set/sitemap.php?lang=cn&admintp=&langset=cn');  
		}				
	});
</script>

<link rel="stylesheet" href="../../editor/themes/default/default.css" />
	<link rel="stylesheet" href="../../editor/plugins/code/prettify.css" />
	<script charset="utf-8" src="../../editor/kindeditor.js"></script>
	<script charset="utf-8" src="../../editor/lang/zh_CN.js"></script>
	<script charset="utf-8" src="../../editor/plugins/code/prettify.js"></script>
<script>

		KindEditor.ready(function(K) {
			var editor1 = K.create('textarea[name="content"]', {
				cssPath : '../../editor/plugins/code/prettify.css',
				uploadJson : '../../editor/php/upload_json.php',
				fileManagerJson : '.../../editor/php/file_manager_json.php',
				allowFileManager : true,
				afterCreate : function() {
					var self = this;
					K.ctrl(document, 13, function() {
						self.sync();
						K('form[name=myform]')[0].submit();
					});
					K.ctrl(self.edit.doc, 13, function() {
						self.sync();
						K('form[name=myform]')[0].submit();
					});
				}
			});
			prettyPrint();
		});
	</script>
<title>添加内容</title>
<script language = 'JavaScript'>
var onecount;
subcat = new Array();
onecount=0;
function Checkimg(){ 
if (document.myform.title.value==null || document.myform.title.value.length == 0) {
	alert(user_msg['js13']);
	document.myform.title.focus();
	return false;
}
if (document.myform.class2.value =='0') {
	alert(user_msg['js14']);
	document.myform.class2.focus();
	return false;
}
}</script>
</head>
<body>
<form  method="POST" name="myform" action="../control.php?oper=article_tab&class=<?=$class.$id_get;?>" target="_self">
	
<table cellpadding="2" cellspacing="1" class="table">
          <tr> 
            <td colspan="3" class="title">添加内容</td>
          </tr>		  

		  <tr> 
            <td class="text"><font class="must">*</font>标题</td>
            <td colspan="2" class="input"> <input name="title" type="text" class="text nonull" value="<?=$title;?>"></td>
          </tr>
           <tr> 
            <td class="text"><font class="must">*</font>排序</td>
            <td colspan="2" class="input"> <input name="order" type="text" class="text nonull" value="<?=$order;?>"></td>
          </tr>
          <tr> 
            <td class="text"><font class="must">*</font>是否置顶</td>
            <td colspan="2" class="input"> <input name="top" type="text" class="text nonull" value="<?=$top;?>"></td>
          </tr>
          <tr> 
            <td class="text"><font class="must">*</font>是否推荐</td>
            <td colspan="2" class="input"> <input name="recommend" type="text" class="text nonull" value="<?=$recommend;?>"></td>
          </tr>
 <tr> 
            <td class="text">图片地址<br><font color='red' >自动生成缩略图</span></td>
            <td colspan="2" class="input upload"> 
				<input name="imgurl" id="imgurl" type="text" class="text" value="<?=$imgurl;?>"> 
				<div id='up_img'><iframe ID="UploadFiles" src="../include/upload_photo.php?class=article_tab&imgurl=<?=$imgurl;?>&lang=cn&imgtype=2&id=<?=$id;?>" frameborder=0 scrolling=no></iframe></div>
				
           
				</td>
          </tr> 
		  <tr> 
            <td class="text">关键词</td>
            <td colspan="2" class="input"><input name="keyword" type="text" class="text" value="<?=$keyword;?>">用于搜索引擎优化,多个关键词请用","隔开</td>
          </tr>
		  <tr> 
            <td class="text">简短描述<br>用于搜索引擎优化
			</td>
            <td class="input" colspan="2"><textarea name="description" cols="60" class="textarea gen" rows="5" ><?=$decription;?></textarea></td>
			</tr> 
			 <tr> 
            <td class="text">
			
        详细内容
		
			</td>
            <td class="input" colspan="2">
			<div class="edir-hide">
			<div class="left-hiden"></div>
<script type="text/javascript" src="../ckeditor/ckeditor.js"></script>
			<textarea class="ckeditor" name="content"><?=$content;?></textarea>

</div>
</td></tr>

		  <tr> 
            <td class="text"></td>
	      <td class="submit"><input type="submit" name="Submit" value="保存" class="submit" onclick="return Smit($(this),'myform')" /><input type="reset" name="Submit" value="重置" class="reset" /> </td>
          </tr>
		<tr>
		  <td class="footer" colspan="2"> </td>
	  </tr>
</table>        
</form>
</body>
</html>
